# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Gilles CHAUVIN <gcnweb@gmail.com>

pkgname=live-media
pkgver=2021.08.24
pkgrel=1
pkgdesc='Set of C++ libraries for multimedia streaming'
url='http://live555.com/liveMedia'
arch=('x86_64')
license=('LGPL')
depends=('gcc-libs' 'openssl')
options=('staticlibs')
source=(https://download.videolan.org/contrib/live555/live.${pkgver}.tar.gz)
sha256sums=('ce95a1c79f6d18e959f9dc129b8529b711c60e76754acc285e60946303b923ec')
sha512sums=('f776e43a9b0792fd41e43f3c06e48f5d766c405d6af4ed5ddac108723f222c844ec5dbe29701b62dff760fbed777935ffc9149080b45d7a7b4c655a7f1fe6dae')

build() {
  cd live
  sed -E 's|(-DSOCKLEN_T=socklen_t)|\1 -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1|g' -i config.linux
  ./genMakefiles linux
  make
}

package() {
  cd live
  for dir in BasicUsageEnvironment groupsock liveMedia UsageEnvironment; do
    install -Dm 644 ${dir}/*.a -t "${pkgdir}/usr/lib"
    install -Dm 644 ${dir}/include/*.h* -t "${pkgdir}/usr/include/${dir}"
  done
  find testProgs -type f -perm 755 -print0|xargs -0 -I '{}' install -Dm 755 '{}' -t "${pkgdir}/usr/bin"
}

# vim: ts=2 sw=2 et:
